﻿using System.Web.UI;
using System;
using StockholmsStad.Web.UI.Class.Utilities;

namespace VigselPartner
{
    /// <summary>
    /// Mallsida för webben
    /// </summary>
    public partial class Site : MasterPage
    {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public string GenerateItemTemplate()
        {
            if(PublicSiteMapDataSource.Provider.CurrentNode != null)
                return String.Format("<li{0}><a href=\"{1}\" title=\"{2}\"><span>{3}</span></a></li>", 
                    PublicSiteMapDataSource.Provider.CurrentNode.Title == Eval("title") ? 
                    " id=\"current\"" : 
                    "", Eval("url"), Eval("description"), Eval("title"));

            return "";
        }

        protected void LoginStatus1_LoggedOut(object sender, EventArgs e)
        {
            //Abandon Current Session
            HttpSessionAdapter session = new HttpSessionAdapter(Session);
            session.Abandon();
            Session.Abandon();
            Response.Redirect("~/Default.aspx");
        }

       
    }
}

